/*
Copyright (C) 2010 
Author		  Oliver Schenk
Contact		  Oliver.Schenk76@gmail.com

This program is free software; you can redistribute
it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; 
if not, see <http://www.gnu.org/licenses/>.
*/

package SelfBookingSystem.MyFramework;

import java.util.List;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;


public class ReadConfigXML {

    private String Directory;
    private String XMLFile;
    private List myList;

	
    //Konstruktor setzt Instanzenvariablen auf Defaultwert
    public ReadConfigXML(String myDirectory,String myXMLFile){
    	this.Directory = myDirectory;
    	this.XMLFile = myXMLFile;
    	System.out.println("myDirectory: " + myDirectory);
    	System.out.println("myXMLFile: " + myXMLFile);
    }
    
    public void setValueList(String myXMLElement) throws ConfigurationException{
    	System.out.println("myXMLElement: " + myXMLElement);
		XMLConfiguration fields = new XMLConfiguration(this.Directory + this.XMLFile);
		myList = fields.configurationsAt(myXMLElement);
    }
	
    //getter Methoden
    public List getValueList(){
    	System.out.println("myList: " + myList);

        return myList;
    }
}
